package com.gaogzhen.feign;

import com.gaogzhen.config.feign.OAuth2FeignConfig;
import com.gaogzhen.dto.CoinDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 * @date 2022-12-08 17:23
 */
@FeignClient(name = "finance-service", configuration = OAuth2FeignConfig.class, path = "/coins")
public interface CoinFeign {
    /**
     * 根据coinIds查询coin的map，key为coinId，value为对应的coin对象
     * @param coinIds   coinId集合
     * @return          map
     */
    @GetMapping("/coinsMap")
    public Map<Long, CoinDto> findCoins(@RequestParam List<Long> coinIds);
}
